﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.SessionState;
using System.Web.Services.Protocols;

namespace HZ.DrugTrade.Web.Hospitals.Procurement
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class HospitalLoginCountProduces : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string GoodsID = context.Request["GoodsID"];
            string HospitalID = context.Request["HospitalID"];
            int countProduces = Convert.ToInt32(context.Request["CountProduces"]);
            if (string.IsNullOrEmpty(GoodsID) ||string.IsNullOrEmpty(HospitalID) || countProduces!=0)
            {
                context.Response.Write("2");
            }
            else
            {
                HZ.DrugTrade.BLL.BLL_HospitalLoginPriceGoods bll = new HZ.DrugTrade.BLL.BLL_HospitalLoginPriceGoods();
                HZ.DrugTrade.Model.View.HospitalLoginPriceGoods where = new HZ.DrugTrade.Model.View.HospitalLoginPriceGoods();
                where.GoodsID = GoodsID.Trim();
                where.HospitalID = HospitalID.Trim();
                where.HospitalName = CurrentAccount.GetUser().UserName;//医院名称
                where.AreaID = CurrentAccount.GetUser().Org.Area.AreaID;//地区ID
                where.CountProduces = new  HZ.Common.ConvertHelper( countProduces).ToInt32;//数量)

                context.Response.Write(bll.UpdateGoodsLoginPrice(where));
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
